import React, { Component } from 'react'
import { BrowserRouter as Router, Route, Switch } from 'react-router-dom'
import Home from '../pages/Home/Home'
import Login from '../pages/Login/Login'
import Register from '../pages/Register/Register'
import GoodsDetail from '../pages/GoodsDetail/GoodsDetail'
import Cart from '../pages/Cart/Cart'
import Order from '../pages/Order/Order'

export default class router extends Component {
  render () {
    return (
      <Router>
        <Switch>
          <Route exact path = "/" component = {Home} />
          <Route path = "/login" component = {Login} />
          <Route path = "/register" component = {Register} />
          <Route path = "/goodsDetail/:gid" component = {GoodsDetail} />
          <Route path = "/cart" component = {Cart} />
          <Route path = "/user/order" component = {Order} />
        </Switch>
      </Router>
    )
  }
}
